const low = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const path = require('path');
const rootdir = process.cwd();

const roledb = new FileSync(path.join(rootdir, 'db/role.json'));
const goodsdb = new FileSync(path.join(rootdir, 'db/goods.json'));
const equipmentdb = new FileSync(path.join(rootdir, 'db/equipment.json'));

const role = low(roledb);
const goods = low(goodsdb);
const equipment = low(equipmentdb);

role.defaults({}).write();
goods.defaults({}).write();
equipment.defaults({}).write();

module.exports = {
    role, goods, equipment
}